package com.tyk.bookstore.front.product.controller;


import com.tyk.bookstore.front.common.core.model.result.R;
import com.tyk.bookstore.front.product.model.vo.ClazzNestVo;
import com.tyk.bookstore.front.product.service.ClassificationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * @author tyk
 * @description 分类管理
 */
@RequestMapping({"api/product/classification"})
@Tag(name = "商品管理/分类管理", description = "分类管理")
@RestController
@RequiredArgsConstructor
public class ClazzController {

    private final ClassificationService classificationService;

    @GetMapping({"list/nest"})
    @Operation(summary = "获取嵌套分类列表", description = "获取嵌套分类列表")
    public R<List<ClazzNestVo>> getNestList() {
        return R.ok(classificationService.getNestList());
    }
}
